<script type="text/javascript">
	function SlideDisplayCtrl($element, $http, UploadService) {
		var ctrl = this
		this.load = function () {
			$http.post(':root/slide/getSlides').success(function (r) {
				ctrl.slides = r
				if (r && r.length > 0) {
					setTimeout(function () {
						$element.find('.carousel').carousel({
							interval: 3000
						})
					})
				}
			})
		}
		this.toUrl = function (tpId) {
			var imageUrl = tpId ? (UploadService.getServerUrl() + '/preview/getImage?hash=' + tpId.split('/')[0] + '&size='
				+ tpId.split('/')[1] + ('&w=1150&h=300')) : 'asset/images/02.jpg';
			return imageUrl;
		}
	}

</script>
<div>
	<div class="" style="" ng-controller="SlideDisplayCtrl as ctrl" ng-init="ctrl.load()">
		<div class="container ">
			<div class="row">
				<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
					<ol class="carousel-indicators">
						<li ng-repeat="s in ctrl.slides" data-slide-to="{{$index}}" data-target="#carousel-example-generic" ng-class="{'active':$index==0}"></li>
					</ol>
					<div class="carousel-inner" role="listbox">
						<div class="item" ng-repeat="s in ctrl.slides" ng-class="{'active':$index==0}">
							<img class="center-block" ng-src="{{ctrl.toUrl(s.fjId)}}" data-holder-rendered="true">
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="container main">
		<course-list filter="false"></course-list>
	</div>
</div>